// <copyright file="MaskBase.cs" company="TenneySoftware">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>Robert Tenney</author>
// <email>rob10e@yahoo.com</email>
// <date>April 2009</date>
// <summary>An abstract class for level mask generation.</summary>

// License:

// Product: LevelGenerator Library .Net
// Author: Robert N. Tenney
// Copyright: April 2009

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation version 2
// of the License.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

// This license covers all source code, binaries, and other materials related to this project
// unless specifically stated otherwise.

using System;
using System.Drawing;

namespace TenneySoftware.LevelGenerator {
    /// <summary>
    /// An abstract class for level mask generation. The mask is used to define where the generations of different
    /// structure types may be built.
    /// </summary>
    public abstract class MaskBase {
        /// <summary>
        /// The size of the mask level.
        /// </summary>
        private Size size;
        
        /// <summary>
        /// The bounds of the mask level.
        /// </summary>
        private Rectangle bounds;

        /// <summary>
        /// Initializes a new instance of the MaskBase class.
        /// </summary>
        protected MaskBase() {
        }

        /// <summary>
        /// Gets the size for the mask level.
        /// </summary>
        /// <value>
        /// The size for the mask level.
        /// </value>
        public Size Size {
            get {
                return this.size;
            }
        }
        
        /// <summary>
        /// Gets the width for the mask level.
        /// </summary>
        /// <value>
        /// The width for the mask level.
        /// </value>
        public int Width {
            get {
                return this.size.Width;
            }
        }
        
        /// <summary>
        /// Gets the height for the mask level.
        /// </summary>
        /// <value>
        /// The height for the mask level.
        /// </value>
        public int Height {
            get {
                return this.size.Height;
            }
        }
        
        /// <summary>
        /// Gets the bounds for the mask level.
        /// </summary>
        /// <value>
        /// The bounds for the mask level.
        /// </value>
        public Rectangle Bounds {
            get {
                return this.bounds;
            }
        }
        
        /// <summary>
        /// Sets the size for the mask level.
        /// </summary>
        /// <param name="size">The size to set the level to.</param>
        protected void SetSize(Size size) {
                this.size = size;
                this.bounds = new Rectangle(Point.Empty, this.size);
        }
    }
}
